#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int n = 0;
    int max = 0;
    int a = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &a);
        if (max < a)
        {
            max = a;
        }
    }
    printf("%d", max);
    return 0;
}